var Select2Util = function () {

    return{
        getQueryString: function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); // 匹配目标参数
            var result = window.location.search.substr(1).match(reg); // 对querystring匹配目标参数
            if (result != null) {
                return decodeURIComponent(result[2]);
            } else {
                return null;
            }
        },
        loadCatalog:function () {
            $('select[name="newTreeName"]').select2({
                ajax: {
                    url: "api/catalog/findAllCataLogToSelect2",
                    dataType: 'json',
                    processResults: function (data, params) {
                        return {
                            results: data.data
                        };
                    }
                }
            });

            $('#newNodeAttr select').select2({
                ajax: {
                    url: "api/catalog/findAllCataLogToSelect2",
                    dataType: 'json',
                    processResults: function (data, params) {
                        return {
                            results: data.data
                        };
                    }
                }
            });
        },
        onChange:function () {
            var type=$('#type').val();
            if(type =='no_real'){
                $('#number').text('数据包个数');
            }else {
                $('#number').text('当前条数');
            }
        }

    }
}()